
import { HTTP } from '../utils/request';
const http = new HTTP();

// 获取项目佣金信息
export function queryProjectSettlementRate(startTime = '',endTime = '',page = 1){
  return http.request({
    url: '/v1/applet/settlement/gather',
    method: 'get',
    data: {
      'startTime': startTime, // 开始时间
      'endTime': endTime, // 结束时间
      'pageIndex': page,
      'pageSize': 10, 
    }
  })
}

// 获取推广佣金信息
export function queryShareAwardRecord(startTime = '',endTime = '',customerName = '',page = 1){
  return http.request({
    url: '/v1/applet/award/record/gather',
    method: 'get',
    data: {
      'settlementStartTime': startTime, // 开始时间
      'settlementEndTime': endTime, // 结束时间
      'customerName': customerName, // 客户名称
      'pageIndex': page,
      'pageSize': 10, 
    }
  })
}

// 领取推广佣金
export function receiveAward(awardId){
  return http.request({
    url: '/v1/applet/award/receive/' + awardId,
    method: 'post',
    data: {}
  })
}

// 确认领取推广佣金
export function confirmReceiveAward(awardId,bankCardId){
  return http.request({
    url: '/v1/applet/award/receive/confirm',
    method: 'post',
    data: {
      'awardId': awardId, // 佣金ID
      'bankCardId': bankCardId, // 收款账户ID
    }
  })
}

// 推广佣金详情信息
export function shareAwardDetail(awardId){
  return http.request({
    url: '/v1/applet/award/detail/' + awardId,
    method: 'post',
    data: {},
  })
}

// 获取我的佣金信息
export function queryUserRate(){
  return http.request({
    url: '/v1/applet/user/my/award',
    method: 'get',
    data: {}
  })
}